package com.tea.app.moudles.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tea.common.entity.app.Goods;
import com.tea.common.entity.app.vo.GoodsMenuVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;

@Mapper
public interface GoodsMapper extends BaseMapper<Goods> {
    
    @Select("SELECT g.*, gc.name as goodsCategoryName " +
           "FROM goods g " +
           "LEFT JOIN goods_category gc ON g.goods_category_id = gc.id " +
           "WHERE g.is_sell = 1 " +
           "ORDER BY gc.sort, g.sort")
    List<GoodsMenuVO> getGoodsMenuDetailList();
}
